$(document).ready(function(){
	$(".friendaction").click(function(){
		var url = $(this).attr("href");
		$.get(url,{ajax:1},function(data){
			var href = $(".friendaction").attr("href");
			if("requestsuccess" == data){//好友申请
				$(".friendaction").attr("href",url.replace("sendrequest","remove"));
				$(".friendaction").text("已经发送申请,撤消?");
			}else if("removerequestsuccess" == data){ //撤消好友申请
				$$(".friendaction").attr("href",url.replace("remove","sendrequest"));
				$(".friendaction").text("加为好友");
			}else{
				msg($(".friendaction"),"操作失败，你可以重试");
			}
		});
		return false;
	});
});


